require "#{RAILS_ROOT}/app/classes/cat/cat_item"
require "#{RAILS_ROOT}/app/classes/irt/irt_examinee"

#* cat_examinee.rb
#* Copyright (C) 2010  Embian Inc.
#
#  This program is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, either version 3 of the License, or 
#  (at your option) any later version.
#  
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#  
#  You should have received a copy of the GNU General Public License
#  along with This program.  If not, see <http://www.gnu.org/licenses/>.
#  
#* Extends IRTExaminee class
#* Author: KyoungMo Yang(E-mail : mo@embian.com)
#* Modified: 2010-11-30
#* References: CATExam
class CATExaminee < IRTExaminee
  
  #* Functionailities
  # * Adds response
  #* Parameters 
  # * [response] : response (Integer)
  #* Return
  # * N/A
  #* Note
  # * N/A
  def add_response(response)
    #TODO : implements to adds response of politomous model
    @responses << response.to_i
  end
  
  #* Functionailities
  # * Returns response for the given CATItem
  #* Parameters 
  # * [response] : response (Integer)
  #* Return
  # * N/A
  #* Note
  # * N/A
  def get_response_for(cat_item)
    raise "Invalid paramter that must be an instance of CATItem class" unless cat_item.is_a? CATItem
    return @responses[cat_item.no-1]
  end
end